<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/fuman/css/style.default.css" type="text/css" />
<title>订单报表</title>
<script language="javascript">
function checkson(sonid){
   if(document.getElementById("son"+sonid) != null){//判断有无子菜单
      //如果有子菜单，则子菜单的所有check状态和父亲一样
      var inputs = document.getElementsByName("shopname[]");
      for(var i=0;i<inputs.length;i++){
         if(inputs[i].id == "son"+sonid){
            if(document.getElementById("pre"+sonid).checked == true){
               inputs[i].checked = true;
            }else{
               inputs[i].checked = false;;
            }
         }
      }
   }
}

function searchform()
	{
		$("#timeerr").html('');
		if($("#starttime").val()=="")
		{
			$("#timeerr").html('<font color=red>请输入查询时间！</font>');
			return false;
		}
		
		if($("#endtime").val()=="")
		{
			$("#timeerr").html('<font color=red>请输入查询时间！</font>');
			return false;
		}
		 var vote_arr = document.getElementsByName("shopname[]");
		 var idarr = new Array();
		var i=0;
		var str="";
		for(var j = 0; j < vote_arr.length; j++)
		{
		   if(vote_arr[j].checked == true)
		   {
			   idarr[i] = vote_arr[j].value;
			   str += vote_arr[j].value+",";
			   i++;
		   }
		   
		}
		
		$("#otherForm").submit();
	}
</script>
<body class="withvernav" >
 <div class="centercontent">
 <div class="pageheader notab">
      <h1 class="pagetitle">日收入报表 </h1>
      <span class="pagedesc">不选择店铺，查询所有<br></span>
      <div class="menulist">
        <ul class="profile_summary">
        </ul>
      </div>
    </div>
</div>
<div class="bodywrapper">
    <!--pageheader-->
    <form class="stdform stdform2"  id="otherForm" method="post" action="/report/ajaxbutton?op=immediatereportDay">
    <div id="contentwrapper" class="contentwrapper">
      <div id="basicform" class="subcontent">
          <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
            <colgroup>
            <col class="con1" />
            <col class="con0" />
            </colgroup>
            <thead>
             <tr>
                <td colspan="3"  class="head0"><button type="button" class="submit radius2" id="btn" onClick="searchform()" >查询报表</button></td>
              </tr>
              <tr>
                <td  class="head0">时间</td>
                <td  class="head0"><input type="text"  name="starttime" id="starttime" value="{{$starttime}}" onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
                  -
                  <input type="text"  name="endtime" value="{{$endtime}}" id="endtime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /></td>
              </tr>
              <tr>
                <td  class="head0">店铺列表</td>
                
                <td  class="head0"> {{foreach from=$shopname item=li key=key}}
                  <br> <h4> <input type="checkbox" name="shopID[]" id="pre{{$li.0.platfromname}}" value="{{$li.0.platfromname}}" onClick="checkson('{{$li.0.platfromname}}');"  /> 【{{$key}}平台】</h4>
               
                  <hr>
                
                  {{foreach from=$li name=infolist item=res key=key}}
                  
                  <div style="width:200px; float:left;overflow:hidden; text-overflow:ellipsis; white-space:nowrap;">
                    <input type="checkbox" name="shopname[]" id="son{{$res.platfromname}}" value="{{$res.name}}" data-text="{{$res.id}}"  />
                    {{$res.name}} </div>
                   {{if $smarty.foreach.infolist.iteration % 7==0}}
                   <br> 
                    {{/if}}
                  &nbsp;&nbsp;{{/foreach}} <br>
                 
                   <br>  <br>   <br> 
                 <div style="clear:both"></div>
                  {{/foreach}} </td>
              </tr>
              <tr>
                <td colspan="3"  class="head0"><button type="button" class="submit radius2" id="btn" onClick="searchform()" >查询报表</button></td>
              </tr>
            </thead>
          </table>
        <br />
      </div>
      <!--subcontent--> 
      
      <!--subcontent--> 
     
    </div>
    <!--contentwrapper--> 
     </form>
  </div>
  <!-- centercontent --> 
  
</div>
<script>
function checkCountry(){
   if(window.opener.document.getElementById("shopnameid") != null){
      var checkcountryname = window.opener.document.getElementById("shopnameid").value;
      if(checkcountryname.length > 0){
         checkcountryname = ";"+checkcountryname+";";
         var objs = document.getElementsByName("shopname");
         
         if(objs != null && objs.length > 0){
            for(var i=0;i<objs.length;i++){
               if(checkcountryname.indexOf(";"+objs[i].value+";") >= 0){
                  //alert("包含");
                  objs[i].checked = true;
               }
            }
         }
      }
   }
}
checkCountry();
</script>

<!--bodywrapper-->
</body>
</html>